package zyh.struts2.action;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import zyh.struts2.beans.User;

public class HelloAction extends ActionSupport {
    private User user;

    @Override
    public String execute() throws Exception {
        ActionContext ctx = ActionContext.getContext();
            System.out.println("服务器提示：登陆成功");
                    return SUCCESS;
    }

    public String regist() throws Exception
    {
        System.out.println(user.getUsername());
        System.out.println(user.getPassword());
        System.out.println(user.getName());
        System.out.println(user.getAge());
        return SUCCESS;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
}
